<div class="content">
	<div class="content_header_left">
		<!-- Start Content Header Left -->
		<?php include("ws_includes/1_ws_inc_priviligestring.php"); ?>
		<?php include("ws_includes/2_ws_inc_headerlabel.php"); ?>
		<!-- End Content Header Left -->
	</div>
	<div class="content_header_right">
		<!-- Start Content Header Right -->
		<?php if($privilegeAdd == 1) { ?>
		<a title="Add" href="action/act_users_addedit.php" class="nyroModal">
			<img src="<?php echo getURLdomain(); ?>/source/global/img/add-icon.png" width="24">
		</a>
		<?php } ?>
		<!-- End Content Header Right -->
	</div>
	<div style="clear:both;"></div>
	<div class="content_body">
		<!-- Start Content Body -->
		<?php
			$sql = "	select a.*, b.usergroupname
						from ms_user a
							left join ms_user_group b
								on a.usergroupid = b.usergroupid
									and b.usergroupstatus = 1
									and b.stsrc = 'A'
						where 	b.usergroupid >= ".$_SESSION['usergroupid']."
							and a.userstatus = 1
							and a.stsrc= 'A'
						order by userid asc
					";
			$exe = mysql_query($sql) or die(mysql_error());
			
			$num = mysql_num_rows($exe);
		
			if($num > 0)
			{
		?>
		<table id="table" border="1" cellpadding="2" cellspacing="0">
		<thead>
			<tr>
				<th filter="false">#</th>
				<th>Name</th>
				<th>Group</th>
				<th filter-type='ddl'>Status</th>
				<th filter="false">Action</th>
			</tr>
		</thead>
		<?php
				$number_count = 1;
				while($row = mysql_fetch_array($exe))
				{
		?>
			<tr>
				<td><?php echo $number_count; ?></td>
				<td><?php echo $row['username']; ?></td>
				<td><?php echo $row['usergroupname']; ?></td>
				<td>
					<?php if($row['userstatus'] == 1){echo "<span style='color:green;'>ON</span>";}else{echo "<span style='color:red;'>OFF</span>";} ?>
				</td>
				<td>
					<div style="width:100%;">
						<div class="divRowActionCell">
							<div class="divRowAction">
								<a title="Preview" href="action/act_users_preview.php#<?php echo $row['userid']; ?>" class="nyroModal">
									<img src="<?php echo getURLdomain(); ?>/source/global/img/preview-icon.png" width="24">
								</a>
							</div>
							<?php if($row['usergroupid'] > $_SESSION['usergroupid']){ ?>
							<?php if($privilegeEdit == 1) { ?>
							<div class="divRowAction">
								<a title="Edit" href="action/act_users_addedit.php#<?php echo $row['userid']; ?>" class="nyroModal">
									<img src="<?php echo getURLdomain(); ?>/source/global/img/edit-icon.png" width="24">
								</a>
							</div>
							<?php } ?>
							<?php } ?>
							<?php if($row['usergroupid'] > $_SESSION['usergroupid']){ ?>
							<?php if($privilegeDelete == 1) { ?>
							<div class="divRowAction">
								<a title="Delete" href="action/act_users_delete.php#<?php echo $row['userid']; ?>" class="nyroModal">
									<img src="<?php echo getURLdomain(); ?>/source/global/img/delete-icon.png" width="24">
								</a>
							</div>
							<?php } ?>
							<?php } ?>
							<div class="clear"></div>
						</div>
					</div>
				</td>
			</tr>
		<?php
					$number_count++;
				}
			}
			else
			{
		?>
				No data !
		<?php
			}
		?>
		</table>
		<!-- End Content Body -->
	</div>
	<div style="clear:both;"></div>
</div>